package com.wuliu.servlet;

import com.wuliu.dao.SecondImageDAO;
import com.wuliu.dao.impl.SecondImageDAOImpl;
import com.wuliu.model.SecondImage;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/admin/second_image")
public class AdminSecondImageServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        SecondImageDAO secondImageDAO =new SecondImageDAOImpl();
        List<SecondImage> secondImages = secondImageDAO.findAll();;
        req.setAttribute("secondImages",secondImages);
        req.getRequestDispatcher("/WEB-INF/view//admin/second_image.jsp").forward(req,resp);
    }
}
